package com.fesine.ch02.synchronizedBlockLockAll.test1;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/5 11:29
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/5 11:29
 */
public class Service {
    public void testMehod1(MyObject object) {
        synchronized (object) {
            try {
                System.out.println("testMethod1_getLock time="+System.currentTimeMillis()+
                " run ThreadName="+Thread.currentThread().getName());
                Thread.sleep(2000);
                System.out.println("testMethod1_releaseLock time="+System.currentTimeMillis()+
                        " run ThreadName="+Thread.currentThread().getName());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
